package com.cici.sort;

import java.util.Arrays;
/**
 * 
 * @author cici
 *
 */
public class SelectSort {
	public static void main(String[] args) {
		int[] arr = {6,72,57,88,60,43,83,73,48,85};
		sort(arr);
		System.out.println(Arrays.toString(arr));
	}

	private static void sort(int[] arr) {
		int n = arr.length;
		for (int i = 0;i < n; i++) {
			int k  = i;
			for(int j= i + 1; j < n; j++){
				if (arr[j] < arr[k]){
					k = j;
				}
			}
			if(arr[k] < arr[i]){
				int temp = arr[i];
				arr[i] = arr[k];
				arr[k] = temp;
			}
		}
	}
}
